package code.structure.module.scene.view.iso
{
	import code.main.AppData;
	import code.structure.module.configs.data.ItemConfigData;
	import code.structure.module.scene.view.YIsoWorld;
	import code.untils.IsoStatusConst;
	import code.untils.SceneConfig;
	
	
	
	/**
	 *纯粹的装饰性质 
	 * @author Yuri
	 * 
	 */
	public class DecorateIsoObject extends YIsoObject
	{
		
		private var _isInteraction:Boolean;
		public function DecorateIsoObject()
		{
			super();
//			isNeedAnimation = false;
			animationFrame = 15;
		}
		
		override protected function refresh():void{
			_isBodyAnimation = true;
			super.refresh();
		}
		
		 /**
		*更新鼠标响应属性 
		* 
		*/
		override public function refreshEnable():void{
			if(!isUnlock){
				/*mouseMoveEnabled = clickEnabled = isUnlock;*/
				isResponseMouse = isUnlock;
				return;
			}
			if(!AppData.isMyScene){
				/*mouseMoveEnabled = clickEnabled = false;*/
				isResponseMouse = false;
				return;
			}else{
				if(parentWorld){
					if(isInteraction){
						isResponseMouse = true;
						return;
					}
					isResponseMouse = (parentWorld as YIsoWorld).status == SceneConfig.SCENE_DIY?isCanDiy:false;
				}
			}
		}
		
		/**
		 *升级 
		 */
		override public function upgrade(d:ItemConfigData):void{
			//替换场景信息 其余绑定等信息保留
			data.itemID = d.id;
			data.data = d;
			clear();
			refreshMaterial(data.data.sPath,SceneConfig.SCENE_CLASS_NAME);
		}

		/**
		 *是否需要交互 
		 */
		public function get isInteraction():Boolean
		{
			return _isInteraction;
		}

		/**
		 * @private
		 */
		public function set isInteraction(value:Boolean):void
		{
			_isInteraction = value;
			status = IsoStatusConst.ISO_STATUS_NORMAL;
			refreshEnable();
		}

	}
}